package com.example.demo.handler;

import com.example.demo.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import reactor.core.publisher.Mono;

@RestControllerAdvice
public class GlobleExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Mono<Result> exceptionHandler(Exception e){
        e.printStackTrace();
        return Mono.just(new Result(500,"系统错误"));
    }
}
